//
//  LHQLikeTableViewCell.m
//  Music
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LHQLikeTableViewCell.h"

@implementation LHQLikeTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super  initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        self.mimageView = [[UIImageView  alloc] init];
        [self.contentView  addSubview:_mimageView];
        
        self.numLabel = [[UILabel  alloc] init];
        self.numLabel.textColor = [UIColor colorWithRed:0.49 green:0.50 blue:0.50 alpha:1.00];
        self.numLabel.font =  [UIFont  fontWithName:@"Helvetica-Oblique" size:10];
        
        [self.contentView  addSubview:_numLabel];
        self.albumName = [[UILabel  alloc] init];
        self.albumName.textColor = [UIColor  blackColor];
        self.albumName.font =  [UIFont  fontWithName:@"Helvetica-Oblique" size:14];
        [self.contentView  addSubview:_albumName];
        self.name = [[UILabel  alloc] init];
        [self.contentView  addSubview:_name];
        self.singerName = [[UILabel  alloc] init];
         self.singerName.textColor = [UIColor colorWithRed:0.49 green:0.50 blue:0.50 alpha:1.00];
        self.singerName.font =  [UIFont  fontWithName:@"Helvetica-Oblique" size:10];
        [self.contentView  addSubview:_singerName];
    }
    return self;
}
-(void)layoutSubviews
{
    [super  layoutSubviews];
    self.numLabel.frame = CGRectMake(10, 25, 20, 10);
    self.albumName.frame = CGRectMake(self.numLabel.frame.origin.x+self.numLabel.frame.size.width+10, 5, 200, 30);
    self.singerName.frame = CGRectMake(self.albumName.frame.origin.x, self.albumName.frame.origin.y+self.albumName.frame.size.height+5, 200, 10);
    self.mimageView.frame = CGRectMake(Screenwidth-self.numLabel.frame.origin.x-self.numLabel.frame.size.width-15, self.numLabel.frame.origin.y-5, 30, 25);

}
-(void)setModel:(LHQlikeModel *)model
{
    if(_model  != model){
        _model  = model;
    }
    self.albumName.text = model.name;
    self.singerName.text = [NSString  stringWithFormat:@"%@ - %@",model.singerName,model.albumName];
    
    self.mimageView.image = [UIImage imageNamed:@"更多"];
    
}









- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
